package com.common.converter;

import com.common.entity.personal.BusinessJobExperienceEntity;
import com.common.entity.personal.JobChangeExperienceEntity;
import com.common.requestvo.judicialpersonal.BusinessJobExperienceReqVo;
import com.common.requestvo.judicialpersonal.JobChangeExperienceReqVo;
import com.common.vo.judicialpersonal.BusinessJobExperienceVo;
import com.common.vo.judicialpersonal.JobChangeExperienceVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface JobChangeExperienceConverter {

    JobChangeExperienceConverter INSTANCE = Mappers.getMapper(JobChangeExperienceConverter.class);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "timeToChange", target = "timeToChange", dateFormat = "yyyy-MM"),
    })
    JobChangeExperienceVo domain2vo(JobChangeExperienceEntity jobChangeExperienceEntity);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "timeToChange", target = "timeToChange", dateFormat = "yyyy-MM"),
    })
    JobChangeExperienceEntity vo2domain(JobChangeExperienceReqVo jobChangeExperienceReqVo);
}